package com.five;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.ObjectInputStream;


public class Fileuse {
	public void file() {
		
		FileInputStream fi=null;
		ObjectInputStream oi=null;
		try {
			fi=new FileInputStream("d:/angelbeats.txt");
			oi=new ObjectInputStream(fi);
			Person ps=(Person)oi.readObject();
		System.out.println(ps);
		}catch(FileNotFoundException e) {
			e.printStackTrace();
		}catch(IOException e) {
			e.printStackTrace();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
			e.printStackTrace();
		}finally {
			try {
				if(fi!=null) {
					fi.close();
				}
			}catch(IOException e) {
				e.printStackTrace();
			}finally {
				try {
					if(oi!=null) {
						oi.close();
					}
				}catch(IOException e) {
					e.printStackTrace();
			}
		}
		
		
		
		
	}
}
}